
{template 'common/header'}


<ul class="nav nav-tabs">
	<li {if $operation == 'display'}class="active"{/if}><a href="{php echo $this->createWebUrl('youhuijuan', array('op' => 'display'))}">优惠卷管理</a></li>
	<li {if $operation == 'post'}class="active"{/if}><a href="{php echo $this->createWebUrl('youhuijuan', array('op' => 'post'))}">{if empty($item['id'])}添加优惠卷{else}编辑优惠卷{/if}</a></li>
</ul>
{if $operation == 'post'}
<div class="main">
	<form action="" method="post" class="form-horizontal form" enctype="multipart/form-data" id="form1">
		<div class="panel panel-default">
			<div class="panel-heading">
				{if empty($item['id'])}添加优惠卷{else}编辑优惠卷{/if}
			</div>
			<div class="panel-body">
				<ul class="nav nav-tabs" id="myTab" role="tablist">
					<li class="active" role="presentation"><a aria-expanded="true" aria-controls="tab_basic" data-toggle="tab" role="tab" href="#tab_basic">基本信息</a></li>
					
				</ul>
				<div class="tab-content">
					<div class="tab-pane  active" id="tab_basic">{template 'web/youhuijuan_basic'}</div>
					
				</div>
			</div>
		</div>
		<div class="form-group col-sm-12">
			<input type="submit" name="submit" value="提交" class="btn btn-primary col-lg-1" />
			<input type="hidden" name="token" value="{$_W['token']}" />
		</div>
	</form>
</div>
{elseif $operation == 'display'}


<div class="main">
	<div class="panel panel-info">
	<div class="panel-heading">筛选</div>
	<div class="panel-body">
		<form action="./index.php" method="get" class="form-horizontal" role="form">
			<input type="hidden" name="c" value="site" />
			<input type="hidden" name="a" value="entry" />
			<input type="hidden" name="m" value="cy163_salesjl" />
			<input type="hidden" name="do" value="youhuijuan" />
			<input type="hidden" name="op" value="display" />
			<div class="form-group">
				<label class="col-xs-12 col-sm-2 col-md-2 control-label">优惠卷关键字</label>
				<div class="col-xs-12 col-sm-4">
					<input class="form-control" name="keyword" id="" type="text" value="{$_GPC['keyword']}">
				</div>
				<div class="col-xs-12 col-sm-4">
					<button class="btn btn-default"><i class="fa fa-search"></i> 搜索</button>
				</div>
			</div>
		</form>
	</div>
</div>
<div class="panel panel-default">
	<div class="panel-body table-responsive">
		<table class="table table-hover">
			<thead class="navbar-inner">
				<tr>
					<th style="width:5%;">ID</th>
					<th style="width:40%;">优惠卷名称</th>
					<th style="width:5%;">满</th>
					<th style="width:10%;">减</th>
					<th style="width:10%;">开始时间</th>
					<th style="width:10%;">结束时间</th>
					<th style="text-align:right;width:10%;">操作</th>
				</tr>
			</thead>
			<tbody>
				{loop $list $item}
				<tr>
					<td>{$item['id']}</td>
					<td>{$item['title']}</td>
					<td>{$item['manPrice']}(元)</td>
					<td>
						<span class="label label-success">{$item['jianPrice']}(元)</span>
					</td>
					<td>
						<span class="label label-info">{$item['starttime']}</span>
					</td>
					<td>
						<span class="label label-primary">{$item['endtime']}</span><br />
					</td>
					<td style="text-align:right;">
						<a href="{php echo $this->createWebUrl('youhuijuan', array('id' => $item['id'], 'op' => 'post'))}" class="btn btn-default btn-sm" data-toggle="tooltip" data-placement="top" title="编辑"><i class="fa fa-pencil"></i></a>
						<a href="{php echo $this->createWebUrl('youhuijuan', array('id' => $item['id'], 'op' => 'delete'))}" onclick="return confirm('此操作不可恢复，确认删除？');return false;" class="btn btn-default btn-sm" data-toggle="tooltip" data-placement="top" title="删除"><i class="fa fa-times"></i></a>
					</td>
				</tr>
				{/loop}
			</tbody>
		</table>
	</div>
	</div>
	{$pager}
</div>
{/if}

{template 'common/footer'}